// 产品介绍
<template>
  <div class="product-content">
    <h1>产品介绍</h1>
    <ul>
      <li :class="{move : isMove}">
        <img src="@/assets/img/项目案例3.png" alt="">
        <p >物业/维保</p>
      </li>
      <li :class="{move : isMove}">
        <img src="@/assets/img/项目案例2.png" alt="">
        <p>电梯物联应用平台</p>
      </li>
      <li :class="{move : isMove}">
        <img src="@/assets/img/项目案例1.png" alt="">
        <p>电梯应急救援处置平台</p>
      </li>
      <li ref="a" :class="{move : isMove}">
        <img src="@/assets/img/项目案例2.png" alt="">
        <p>电梯终端设备</p>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  name: "ProductContent",
  data() {
    return {
      isMove:false
    }
  },
  mounted() {
     window.addEventListener("scroll", this.addMoveClass);
  },
  methods: {
    addMoveClass(e){
      // console.log(document.documentElement.scrollTop)
      if(document.documentElement.scrollTop>= 1600 || document.body.scrollTop >= 1600){
        this.isMove =true
      }
    }
  },
};
</script>
<style lang='scss' scoped>
.product-content {
  height: 736px;
  width: 100%;
  text-align: center;
  overflow: hidden;
  h1 {
    margin-top: 100px;
    font-size: 40px;
    color: black;
  }
  ul {
    display: flex;
    justify-content: center;
    margin-top: 30px;
     
    .move{
      transform: translateX(0)!important;
    }
    li {
      transition: all 2s;
      &:first-child{
      transform: translateX(-400%);
      }
      &:nth-child(2){
      transform: translateX(-300%);
      }
      &:nth-child(3){
       transform: translateX(300%);
      }
      &:last-child{
       transform: translateX(400%);
      }

      margin-left: 20px;
      width: 284px;
      height: 375px;
      background-color: blanchedalmond;
      &:first-child {
        margin-left: 0;
      }
      img{
        width: 100%;
      }
    p{
      margin-top:20px;
      font-size: 16px;
      color: black;
    }
    }
  }
}
</style>